﻿using System;
using UnityEngine;

// Token: 0x02000062 RID: 98
public class GuideDrive : MonoBehaviour
{
	// Token: 0x17000037 RID: 55
	// (get) Token: 0x0600031F RID: 799 RVA: 0x000147A8 File Offset: 0x000129A8
	// (set) Token: 0x06000320 RID: 800 RVA: 0x000147B0 File Offset: 0x000129B0
	public bool OnCursor
	{
		get
		{
			return this.onCursor;
		}
		set
		{
			if (this.onCursor != value)
			{
				this.onCursor = value;
				this.UpdateColor();
			}
		}
	}

	// Token: 0x06000321 RID: 801 RVA: 0x000147CC File Offset: 0x000129CC
	protected void UpdateColor()
	{
		if (this.material == null)
		{
			return;
		}
		if (this.onCursor)
		{
			this.material.color = this.highColor;
		}
		else
		{
			this.material.color = this.baseColor;
		}
	}

	// Token: 0x06000322 RID: 802 RVA: 0x00014820 File Offset: 0x00012A20
	protected void Init()
	{
		Renderer renderer = base.gameObject.GetComponent<Renderer>();
		if (renderer == null)
		{
			renderer = base.gameObject.GetComponentInChildren<Renderer>();
		}
		this.material = renderer.material;
		if (!this.setColor)
		{
			this.SetBaseColor(this.material.color);
		}
		else
		{
			this.UpdateColor();
		}
		this.onCursor = false;
		this.onMove = false;
		this.manager = base.gameObject.GetComponentInParent<GuideDriveManager>();
	}

	// Token: 0x06000323 RID: 803 RVA: 0x000148A4 File Offset: 0x00012AA4
	public virtual void OnMoveStart(Vector3 clickPos)
	{
		this.onMove = true;
		this.movePrevPos = Input.mousePosition;
		this.manager.OnMoveStart(this);
	}

	// Token: 0x06000324 RID: 804 RVA: 0x000148C4 File Offset: 0x00012AC4
	public virtual void OnMoveEnd()
	{
		this.onMove = false;
		this.manager.OnMoveEnd(this);
	}

	// Token: 0x06000325 RID: 805 RVA: 0x000148DC File Offset: 0x00012ADC
	public void SetBaseColor(Color color)
	{
		this.setColor = true;
		this.baseColor = color;
		Color color2 = this.baseColor;
		color2.r *= 1.5f;
		color2.g *= 1.5f;
		color2.b *= 1.5f;
		this.SetHighColor(color2);
	}

	// Token: 0x06000326 RID: 806 RVA: 0x00014940 File Offset: 0x00012B40
	public void SetHighColor(Color color)
	{
		this.highColor = color;
		this.UpdateColor();
	}

	// Token: 0x040002D0 RID: 720
	protected GuideDriveManager manager;

	// Token: 0x040002D1 RID: 721
	protected Material material;

	// Token: 0x040002D2 RID: 722
	protected Color baseColor;

	// Token: 0x040002D3 RID: 723
	protected Color highColor;

	// Token: 0x040002D4 RID: 724
	protected Vector3 movePrevPos;

	// Token: 0x040002D5 RID: 725
	protected bool onCursor;

	// Token: 0x040002D6 RID: 726
	protected bool onMove;

	// Token: 0x040002D7 RID: 727
	protected bool setColor;
}
